﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace diploma.test.core
{
    public class PropertyTable
    {
        public PropertyTable(List<string> _properties)
        {
            this.properties = _properties;
        }

        public void AddStatement(string name)
        {
            AddStatements(new List<string>() { name });
        }

        public void AddStatements(IEnumerable<string> _statements)
        {
            if (statements == null) { statements = new List<string>(); }
            this.statements.AddRange(_statements);
        }

        public string[] Statements
        {
            get
            {
                return this.statements.ToArray();
            }
        }
        public string[] Properties
        {
            get
            {
                return this.properties.ToArray();
            }
        }

        public PropertyItem[] getRowValues(int index)
        {
            return values[index].RowValues;
        }

        public void AddStatmentValues(int index, List<string> rowValues)
        {
            if (values == null) { values = new List<PropertyRow>(statements.Count); }
            PropertyRow tmp = new PropertyRow(properties.Count, properties);
            tmp.modifyRow(rowValues);
            values.Add(tmp);
        }



        private List<PropertyRow> values = null;
        private List<string> properties = null;
        private List<string> statements = null;


    }
}
